import { useStore } from '@/store'
import { Input } from 'antd'
import { useState } from 'react'

function Organize() {
  const getVotes = useStore((state) => state.votes)
  const addVotes = useStore((state) => state.addVotes)
  const subtractVotes = useStore((state) => state.subtractVotes)
  const fetchData = useStore((state) => state.fetchData)

  const [num, setNum] = useState(0)

  const addCount = () => {
    setNum(num + 1)
  }

  return (
    <div className="App">
      {num}
      <Input />
      <h1>{getVotes} people</h1>
      <button onClick={addVotes}> add </button>
      <button onClick={subtractVotes}> Delete </button>
      <button onClick={fetchData}> fetchData </button>

      <button onClick={addCount}> add </button>
    </div>
  )
}

export default Organize
